]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ibusManager: Add call to restart the ibus daemon
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 15 Aug 2019 11:28:59 +0000 (13:28 +0200)
committerCarlos Garnacho <mrgarnacho@gmail.com>
Thu, 5 Sep 2019 07:42:46 +0000 (07:42 +0000)
We may need to restart it with different arguments, so make it
possible to do that. Also, avoid to just restart it on _clear(),
this is now most likely through our --replace call than it is
through ibus-daemon eg. dying, avoids some noise in logs as
there is already an ongoing ibus-daemon.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/680

js/misc/ibusManager.js

index 5a2d24e2fbda5f113c1945832077b389e0107310..6c8266271fa2aa76489268e27850a0db20f94cc3 100644 (file)
@@ -59,15 +59,19 @@ var IBusManager = class {
         this._spawn();
     }
 
-    _spawn() {
+    _spawn(extraArgs = []) {
         try {
-            Gio.Subprocess.new(['ibus-daemon', '--xim', '--panel', 'disable'],
-                               Gio.SubprocessFlags.NONE);
+            let cmdLine = ['ibus-daemon', '--panel', 'disable', '--xim', ...extraArgs];
+            Gio.Subprocess.new(cmdLine, Gio.SubprocessFlags.NONE);
         } catch (e) {
             log(`Failed to launch ibus-daemon: ${e.message}`);
         }
     }
 
+    restartDaemon(extraArgs = []) {
+        this._spawn(['-r', ...extraArgs]);
+    }
+
     _clear() {
         if (this._panelService)
             this._panelService.destroy();
@@ -80,8 +84,6 @@ var IBusManager = class {
         this._currentEngineName = null;
 
         this.emit('ready', false);
-
-        this._spawn();
     }
 
     _onConnected() {